package com.kvn.main.controller;

import com.alipay.jarslink.api.Module;
import com.alipay.jarslink.api.ModuleManager;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;

/**
 * Created by zhiyuan.wang on 2018/4/3.
 */
@Controller
@RequestMapping("/warehourse")
public class WarehourseController {
    @Resource
    private ModuleManager moduleManager;

    @RequestMapping("module/{moduleName}/{actionName}")
    @ResponseBody
    public String bus(@PathVariable("moduleName") String moduleName, @PathVariable("actionName") String actionName, String param){
        System.out.println("moduleName = [" + moduleName + "], actionName = [" + actionName + "], param = [" + param + "]");
        return (String) moduleManager.find(moduleName).doAction(actionName, param);
    }
}
